import request from '@/utils/request'
import { makeFormData } from '@/utils/util'

export function getRecordList (params = {}) {
  return request({
    url: '/crm/fin/refund/list',
    method: 'get',
    params
  })
}

export function getClasses (params = {}) {
  return request({
    url: 'crm/v2/cc/classes',
    method: 'get',
    params
  })
}

export function addRefund (data = {}) {
  return request({
    url: '/crm/fin/refund',
    method: 'post',
    data: makeFormData(data)
  })
}

export function recommendRefund (params = {}) {
  return request({
    url: '/crm/fin/refund_product/recommend_refund',
    method: 'get',
    params
  })
}

export function getRecord (params = {}) {
  return request({
    url: '/crm/fin/refund',
    method: 'get',
    params
  })
}
